<template>
  <div>
    <div ref="myLine" style="width: 1200px;height:400px;"></div>
  </div>
</template>
<script>
let echarts = require("echarts/lib/echarts");
export default {
  name: "Polygonalchart",
  props: ["chartData"],
  mounted() {
    this.drawLine();
  },
  methods: {
    drawLine() {
      let dom = this.$refs.myLine;
      let myLine = echarts.init(dom);
      myLine.setOption({
        textStyle: {
          color: "#fff"
        },
        title: {
          text: "null"//chardata
          ,x: "center",
          textStyle: {
            color: "#fff",
            fontSize: 20,
            fontWeight: "normal"
          },
          top: "10px",
          subtextStyle: {
            color: "#a0a0a0",
            fontSize: 15
          }
        },
        tooltip: {},
        xAxis: {
          data: ["null", "null", "null"]//chardata
          , name: '时间 ',
          nameLocation: 'end',
            nameTextStyle: {
              color: '#00ffff',
            },
            axisLine: {
              show:true,
              lineStyle: {
                color: '#345871',
                width: 3,
              },
              symbol: ['none', 'arrow'],
            },
        },
        yAxis: [
          {
            type: "value",
            name: "null",//chardata
            nameLocation: "end",
            min: 0,
            max: 100,
            interval: 20,
            nameTextStyle: {
              color: "#00ffff"
            },
            axisLine: {
              show: true,
              lineStyle: {
                color: "#2d4359",
                width: 3
              },
              symbol: ["none", "arrow"]
            },
            axisTick: { show: false },
            splitLine: {
              show: true,
              interval: "auto",
              lineStyle: {
                color: ["#345871"],
                type: "dashed"
              }
            },
            axisLabel: {
              formatter: "{value}"
            }
          }
        ],
        series: [
          {
            name: "null",//chardata
            type: "line",
            data: [30, 25, 78],//chardata
          }
        ]
      });
    }
  }
};
</script>